package cn.wolfcode.domain;

import cn.wolfcode.enums.NoticeEnum;
import com.alibaba.fastjson.JSON;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
import org.springframework.format.annotation.DateTimeFormat;

import java.util.Date;

@Getter@Setter@ToString
public class Notice {
    /** */
    private Long id;
    /** 公告通知名称*/
    private String title;
    /** 创建者*/
    private Employee creator;
    /** 创建时间*/
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm")
    private Date creatTime;
    /** 公告等级*/
    private Integer level;
    /** 是否已读*/
    private Boolean readed;
    /** 发布状态(未发布0已发布,1)*/
    private Boolean issue;

    private NoticeMsg noticeMsg;

    public String getLevelName(){
        return NoticeEnum.findName(this.level);
    }

    @Override
    public String toString() {
        return JSON.toJSONString(this);
    }


}